package com.obj;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;


public class ComparableDemo {
	public static void main(String[] args) {


		int[] list = new int[2];
		list[0] = 12;
		list[1] = 10;
		Arrays.sort(list);
		System.out.println(list[0]);

		List<Integer> ll = new ArrayList<>();
		ll.add(11);
		ll.add(11);
		ll.add(22);
		System.out.println(ll.size());

		for (Integer integer : ll) {
			System.out.println(integer);

		}

		Set<Integer> set = new HashSet<>();
		set.add(11);
		set.add(11);
		set.add(12);
		set.add(13);
		System.out.println(set.size());
		Iterator<Integer> iterator = set.iterator();
		while (iterator.hasNext()) {
			System.out.println(iterator.next());

		}
		
		HashMap map=new HashMap<>();
		map.put("123a", 123);
		map.put("123b", 124);
		Set setm=map.keySet();
		Iterator<Integer> iterator2 = setm.iterator();
		while (iterator2.hasNext()) {
			
			System.out.println(iterator2.next());

		}
		
		
		Collection cc=map.values();
		
		
		Iterator<Integer> citerator = cc.iterator();
		while (citerator.hasNext()) {
			
			System.out.println(citerator.next());

		}

	}

}
